import 'package:flutter/material.dart';
import 'package:trollee/app/core/values/colors.dart';

import 'package:trollee/app/core/values/dimens.dart';

class CustomTextInputDecoration {

  // 登录输入框样式设置
  static InputDecoration buildInputDecoration(String text, Widget icon) {
    return InputDecoration(
      hintText: text,
      isCollapsed: true,
      contentPadding: EdgeInsets.symmetric(
        horizontal: AppDimens.dp14,
        vertical: AppDimens.dp14,
      ),
      //内容内边距，影响高度
      prefixIcon: icon,
      prefixIconConstraints: BoxConstraints(
        minWidth: AppDimens.dp30,
        minHeight: AppDimens.dp30,
      ),
      border: InputBorder.none,
      focusedBorder: OutlineInputBorder(
        borderRadius: BorderRadius.circular(AppDimens.dp6),
        borderSide:  const BorderSide(
          color: AppColors.primary_color,
          width: 1,
          style: BorderStyle.solid,
        ),
      ),
    );
  }


  static InputDecoration buildInputDecoration2(String text,) {
    return InputDecoration(
      hintText: text,
      contentPadding: EdgeInsets.only(left: AppDimens.dp8),
      focusedBorder: OutlineInputBorder(
        borderRadius: BorderRadius.circular(AppDimens.dp8),
        borderSide:  const BorderSide(
          color: AppColors.primary_color,
          width: 1,
          style: BorderStyle.solid,
        ),
      )
    );
  }

}
